import {
  createRouter,
  createWebHashHistory
} from 'vue-router'

import accessRouterIndex from '@/access/router/index'

const routes = [{
    path: '/',
    name: 'Root',
    redirect: '/login'
  },
  {
    path: "/login",
    name: "Login",
    component: () => import('@/views/login/Login'),
    meta: {
      isNotNeedLogin: true
    }
  },
  {
    path: "/reg",
    name: "Reg",
    component: () => import('@/views/reg/Reg'),
    meta: {
      isNotNeedLogin: true
    }
  },
  {
    path: "/404",
    name: "Result404",
    component: () => import('@/views/result/Result404'),
  },
  {
    path: "/app",
    name: "App",
    component: () => import('@/views/components/BasicLayout'),
    children: accessRouterIndex.accessRouter
  }
]

const pageNotFind = {
  path: "*",
  redirect: '/404'
}

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router